from collections import defaultdict

print('Please enter Account and Password.')
# account, password = map(str, input().split())
account = 'admin'
password = '123456'


def ProError():
    exit()
    # print('error')


if account == 'admin' and password == '123456':
    print('Success!')
    Is_Exit = False
    while not Is_Exit:
        User_Input = 9
        try:
            print('Please enter your choice?')
            User_Input = int(input())
        except ValueError as err:
            print(err)
            ProError()
        if User_Input == 1:
            print('We will do the max.')
            nums = list(map(int, input().split()))
            print('Which is the small length?')
            k = int(input().strip())
            frequency_map = defaultdict(int)
            for i in range(k):
                frequency_map[nums[i]] += 1
            for i in range(len(nums)-k+1):
                max_r = -1
                for j, num in frequency_map.items():
                    if num == 1:
                        max_r = max(max_r, j)
                print(max_r, end=' ')
                # result.append(max_r)

                # 移动窗口，更新频率表
                if i + k < len(nums):  # 如果右侧有元素
                    frequency_map[nums[i]] -= 1  # 移除左边元素
                    frequency_map[nums[i + k]] += 1  # 加入右边新元素

        if User_Input == 0:
            print('See you next time!')
            Is_Exit = True
        else:
            print()
            print(User_Input)
else:
    print('Fail')
